package com.xingkeduo.remote.feign;

import com.xingkeduo.dto.OrderDetailResponseDto;
import com.xingkeduo.dto.PriceDto;
import com.xingkeduo.dto.RefreshCodeResponseDto;
import com.xingkeduo.dto.param.OrderInitDto;
import com.xingkeduo.dto.param.OrderRefundParamDto;
import com.xingkeduo.dto.param.PaymentParam;
import com.xingkeduo.dto.transter.appointment.OrderAppointmentDto;
import com.xingkeduo.dto.transter.hairstyle.OrderHairDto;
import com.xingkeduo.dto.transter.order.OrderUserResponseDto;
import com.xingkeduo.utils.PageResponseDTO;
import com.xingkeduo.utils.ResponseUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(value = "business-order")
public interface OrderFeignService {

    //根据orderNo查询订单详情
    @RequestMapping("/api/order/info")
    ResponseUtils<OrderDetailResponseDto> queryByOrderNO(@RequestParam(value = "orderNo") String orderNo);

    //获取验证码信息
    @RequestMapping("/api/order/ticket/obtain/code")
    ResponseUtils<RefreshCodeResponseDto> obtainCode(@RequestParam(value = "orderNo") String orderNo);

    //用户端列表查询(用户端)
    @RequestMapping("/api/order/user/query")
    ResponseUtils<PageResponseDTO<OrderUserResponseDto>> userQuery(@RequestParam(value = "userId") String userId,@RequestParam(value = "orderQueryStatus") String orderQueryStatus,@RequestParam(value = "pageNo") int pageNo,@RequestParam(value = "pageSize") int pageSize);


    //更改发型id
    @PutMapping(value = "/api/order/hair/order/no")
    ResponseUtils hair(@RequestBody OrderHairDto orderHairDto);


    //新建订单(用户端)
    @PostMapping(value = "/api/order")
    ResponseUtils insert(@RequestBody OrderInitDto orderInitDto);

    //用户退款
    @PutMapping(value = "/api/order/refund/user")
    ResponseUtils userRefund(@RequestBody OrderRefundParamDto orderRefundParamDto);

    //更改预约时间(支付前)
    @PutMapping(value = "/api/order/appointment")
    ResponseUtils appointment(@RequestBody OrderAppointmentDto orderAppointmentDto);


    @PostMapping("/api/order/to_pay")
    ResponseUtils toPay(@RequestBody PaymentParam paymentParam);

    //根据orderNo查询订单详情
    @RequestMapping("/api/order/query/nopay/info")
    ResponseUtils<OrderDetailResponseDto> getNotPayOrderInfo(@RequestParam(value = "userId") String userId);


    /**
     * 取消订单
     */
    @PutMapping(value = "/api/order/cancelOrder")
    ResponseUtils cancelOrder(@RequestParam(value = "userId") String userId,@RequestParam(value = "orderNo") String orderNo);


    //获取未支付订单
    @PutMapping(value = "/api/order/query/nopay")
    ResponseUtils<String> getNotPayOrderNo(@RequestParam(value = "userId") String userId);


    @GetMapping("/api/order/admin/price")
    ResponseUtils<Map<String, PriceDto>> adminPrice(@RequestParam(value = "adminIds") String adminIds,@RequestParam(value = "storeId") String storeId,@RequestParam(value = "serviceTypeId") String serviceTypeId);


    //更改活动信息
    @PutMapping(value = "/api/order/change/market")
    ResponseUtils changeMarket(@RequestParam(value = "orderNo") String orderNo,@RequestParam(value = "marketId") String marketId,@RequestParam(value = "type") String type);

    //更改预约时间(支付后)
    @PutMapping(value = "/api/order/appointment/completed")
    ResponseUtils appointmentCompleted(@RequestBody OrderAppointmentDto orderAppointmentDto);


    //过号后重新预约(支付后)
    @PutMapping(value = "/api/order/reApply")
    ResponseUtils reApply(@RequestBody OrderAppointmentDto orderAppointmentDto);


    //获取用户类型
    @GetMapping(value = "/api/order/query/user/type")
    ResponseUtils<Integer> queryUserType(@RequestParam(value = "userId") String userId,@RequestParam(value = "storeId") String storeId);

}
